
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>Datum | CRM Admin Dashboard Template</title>
      
      <link rel="stylesheet" href="../assets/css/backend-plugin.min.css">
      <link rel="stylesheet" href="../assets/css/backend.css">  </head>
  <body class="  ">
    <!-- loader Start -->
    <div id="loading">
          <div id="loading-center">
          </div>
    </div>
    <!-- loader END -->
    <!-- Wrapper Start -->
    <div class="wrapper">
        <div th:replace="~{common/left-side-nav::left-side-nav}"></div>
        <div th:replace="~{common/top-nav::top-nav}"></div>

      <div class="content-page">

    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="d-flex flex-wrap align-items-center justify-content-between">
                   <div class="d-flex align-items-center justify-content-between">
                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb p-0 mb-0">
                                <li class="breadcrumb-item"><a href="customer.html">客户信息</a></li>
                                <li class="breadcrumb-item active" aria-current="page">添加新客户</li>
                            </ol>
                        </nav>
                    </div>
                    <a href="customer.html" class="btn btn-primary btn-sm d-flex align-items-center justify-content-between">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" viewbox="0 0 20 20" fill="currentColor">
                            <path fill-rule="evenodd" d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z" clip-rule="evenodd"></path>
                        </svg>
                        <span class="ml-2">返回</span>
                    </a>
                </div>
            </div>
            <div class="col-lg-12 mb-3 d-flex justify-content-between">
                <h4 class="font-weight-bold0 d-flex align-items-center">添加新客户</h4>
            </div>
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="row">

                            <div class="col-md-9">
                                <form class="row g-3 date-icon-set-modal" th:action="@{/KeHuGuanLi/customer_add}" method="post">
                                    <div class="col-md-6 mb-3">
                                        <label for="name" class="form-label font-weight-bold text-muted text-uppercase">客户名称</label>
                                        <input type="text" class="form-control"
                                               th:value="${customer !=null ?customer.name : ''}" required maxlength="50"
                                               id="name"
                                        name="name">
                                        <div class="invalid-feedback">客户名称不能为空，并且不能超过50个字</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('name') ? errorMessage.name : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="area" class="form-label font-weight-bold text-muted text-uppercase">所在地区</label>
                                        <input type="text" class="form-control" id="area" name="area" th:value="${customer !=null ?customer.area : ''}" required maxlength="50">
                                        <div class="invalid-feedback">所在地区不能为空，并且不能超过50个字</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('area') ? errorMessage.area : ''}">错误信息</div>
                                    </div>
<!--                                    <div class="col-md-6 mb-3">-->
<!--                                        <label for="custManagerId" class="form-label font-weight-bold text-muted text-uppercase">客户经理</label>-->
<!--                                        <input type="text" class="form-control" id="custManagerId" name="custManagerId">-->
<!--                                    </div>-->
                                    <div class="col-md-6 mb-3">
                                        <label for="custManagerId" class="form-label font-weight-bold text-muted text-uppercase">客户经理</label>
                                        <select id="custManagerId" class="form-select form-control choicesjs" >
                                            <option class="" selected="">请选择客户经理</option>
                                            <option th:each="cstManager:${cstManager}" th:value="${cstManager.id}"
                                                    th:selected="${customer !=null ? customer.custManagerId == cstManager.id : false}"
                                                    th:text="${cstManager.id}"></option>
                                        </select>
                                        <div class="invalid-feedback">客户经理不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custManagerId') ? errorMessage.custManagerId : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="custLevel" class="form-label font-weight-bold text-muted text-uppercase">客户等级</label>
                                        <input type="text" class="form-control" id="custLevel" name="custLevel" th:value="${customer !=null ?customer.custLevel : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户等级不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custLevel') ? errorMessage.custLevel : ''}">错误信息</div>

                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="custSatisfaction" class="form-label font-weight-bold text-muted text-uppercase">客户满意度</label>
                                        <input type="text" class="form-control" id="custSatisfaction" name="custSatisfaction"
                                               th:value="${customer !=null ?customer.custSatisfaction : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户满意度不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custSatisfaction') ? errorMessage.custSatisfaction : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="custCredit" class="form-label font-weight-bold text-muted text-uppercase">客户信用度</label>
                                        <input type="text" class="form-control" id="custCredit" name="custCredit"
                                               th:value="${customer !=null ?customer.custCredit : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户信用度不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custCredit') ? errorMessage.custCredit : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="zipCode" class="form-label font-weight-bold text-muted text-uppercase">邮政编码</label>
                                        <input type="text" class="form-control" id="zipCode" name="zipCode" th:value="${customer !=null ?customer.zipCode : ''}" required maxlength="50">
                                        <div class="invalid-feedback">邮政编码不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('zipCode') ? errorMessage.zipCode : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="address" class="form-label font-weight-bold text-muted text-uppercase">客户地址</label>
                                        <input type="text" class="form-control" id="address" name="address" th:value="${customer !=null ?customer.address : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户地址不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('address') ? errorMessage.address : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="phone" class="form-label font-weight-bold text-muted text-uppercase">客户联系方式</label>
                                        <input type="text" class="form-control" id="phone" name="phone"
                                               th:value="${customer !=null ?customer.phone : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户联系方式不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('phone') ? errorMessage.phone : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="fax" class="form-label font-weight-bold text-muted text-uppercase">传真号码</label>
                                        <input type="text" class="form-control" id="fax" name="fax"
                                               th:value="${customer !=null ?customer.fax : ''}" required maxlength="50">
                                        <div class="invalid-feedback">传真号码不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('fax') ? errorMessage.fax : ''}">错误信息</div>

                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="site" class="form-label font-weight-bold text-muted text-uppercase">官方网站地址</label>
                                        <input type="text" class="form-control" id="site" name="site"
                                               th:value="${customer !=null ?customer.site : ''}" required maxlength="50">
                                        <div class="invalid-feedback">官方网站不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('site') ? errorMessage.site : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="tradingCertificate" class="form-label font-weight-bold text-muted text-uppercase">营业执照号码</label>
                                        <input type="text" class="form-control" id="tradingCertificate" name="tradingCertificate"
                                               th:value="${customer !=null ?customer.tradingCertificate : ''}" required maxlength="50">
                                        <div class="invalid-feedback">营业执照号码不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('tradingCertificate') ? errorMessage.tradingCertificate : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="legalRepresentative" class="form-label font-weight-bold text-muted text-uppercase">法人代表</label>
                                        <input type="text" class="form-control" id="legalRepresentative" name="legalRepresentative"
                                               th:value="${customer !=null ?customer.legalRepresentative : ''}" required maxlength="50">
                                        <div class="invalid-feedback">法人代表不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('legalRepresentative') ? errorMessage.legalRepresentative : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="registeredFund" class="form-label font-weight-bold text-muted text-uppercase">注册资金</label>
                                        <input type="text" class="form-control" id="registeredFund" name="registeredFund"
                                               th:value="${customer !=null ?customer.registeredFund : ''}" required maxlength="50">
                                        <div class="invalid-feedback">注册资金不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('registeredFund') ? errorMessage.registeredFund : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="annualTurnover" class="form-label font-weight-bold text-muted text-uppercase">年营业额度</label>
                                        <input type="text" class="form-control" id="annualTurnover" name="annualTurnover"
                                               th:value="${customer !=null ?customer.annualTurnover : ''}" required maxlength="50">
                                        <div class="invalid-feedback">年营业额度不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('annualTurnover') ? errorMessage.annualTurnover : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="custBank" class="form-label font-weight-bold text-muted text-uppercase">客户开户银行</label>
                                        <input type="text" class="form-control" id="custBank" name="custBank"
                                               th:value="${customer !=null ?customer.custBank : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户开户银行不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custBank') ? errorMessage.custBank : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="custBankAccount" class="form-label font-weight-bold text-muted text-uppercase">客户开户银行账户</label>
                                        <input type="text" class="form-control" id="custBankAccount" name="custBankAccount"
                                               th:value="${customer !=null ?customer.custBankAccount : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户开户银行账户不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('custBankAccount') ? errorMessage.custBankAccount : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="landTaxNumber" class="form-label font-weight-bold text-muted text-uppercase">地税登记号</label>
                                        <input type="text" class="form-control" id="landTaxNumber" name="landTaxNumber"
                                               th:value="${customer !=null ?customer.landTaxNumber : ''}" required maxlength="50">
                                        <div class="invalid-feedback">地税登记号不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('landTaxNumber') ? errorMessage.landTaxNumber : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="nationalTaxNumber" class="form-label font-weight-bold text-muted text-uppercase">国税登记号</label>
                                        <input type="text" class="form-control" id="nationalTaxNumber" name="nationalTaxNumber"
                                               th:value="${customer !=null ?customer.nationalTaxNumber : ''}" required maxlength="50">
                                        <div class="invalid-feedback">国税登记号不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('nationalTaxNumber') ? errorMessage.nationalTaxNumber : ''}">错误信息</div>
                                    </div>
                                    <div class="col-md-6 mb-3">
                                        <label for="status" class="form-label font-weight-bold text-muted text-uppercase">客户状态</label>
                                        <input type="text" class="form-control" id="status" name="status"
                                               th:value="${customer !=null ?customer.status : ''}" required maxlength="50">
                                        <div class="invalid-feedback">客户状态不能为空</div>
                                        <div class="text-danger mt-2"
                                             th:text="${errorMessage!=null and errorMessage.containsKey('status') ? errorMessage.status : ''}">错误信息</div>
                                    </div>





                                <div class="d-flex justify-content-end mt-3">
                                    <button class="btn btn-primary" type="submit">
                                       添加
                                    </button>
                                </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>                
            </div>
        </div>
    </div>

      </div>
    </div>
    <!-- Wrapper End-->
    <footer class="iq-footer">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-6">
                    <ul class="list-inline mb-0">
                        <li class="list-inline-item"><a href="privacy-policy.html">Privacy Policy</a></li>
                        <li class="list-inline-item"><a href="terms-of-service.html">Terms of Use</a></li>
                    </ul>
                </div>
                <div class="col-lg-6 text-right">
                    <span class="mr-1">Copyright &copy; 2021.Company name All rights reserved.<a target="_blank" href="https://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></span>
                </div>
            </div>
        </div>
    </footer>    <!-- Backend Bundle JavaScript -->
    <script src="../assets/js/backend-bundle.min.js"></script>
    <!-- Chart Custom JavaScript -->
    <script src="../assets/js/customizer.js"></script>
    
    <script src="../assets/js/sidebar.js"></script>
    
    <!-- Flextree Javascript-->
    <script src="../assets/js/flex-tree.min.js"></script>
    <script src="../assets/js/tree.js"></script>
    
    <!-- Table Treeview JavaScript -->
    <script src="../assets/js/table-treeview.js"></script>
    
    <!-- SweetAlert JavaScript -->
    <script src="../assets/js/sweetalert.js"></script>
    
    <!-- Vectoe Map JavaScript -->
    <script src="../assets/js/vector-map-custom.js"></script>
    
    <!-- Chart Custom JavaScript -->
    <script src="../assets/js/chart-custom.js"></script>
    <script src="../assets/js/01.js"></script>
    <script src="../assets/js/02.js"></script>
    
    <!-- slider JavaScript -->
    <script src="../assets/js/slider.js"></script>
    
    <!-- Emoji picker -->
    <script src="../assets/js/index.js" type="module"></script>
    
    
    <!-- app JavaScript -->
    <script src="../assets/js/app.js"></script>  </body>
  <script>
      //为表单注册提交事件
      $('form.row g-3 date-icon-set-modal').submit(function (event) {
          //调用表单对象的验证方法，如果验证方法返回true ，说明表单所有的域都填写正确。否则返回false
          if(this.checkValidity()==false){
              //为表单添加验证失败后的样式类。
              $(this).addClass('was-validated')
              return false;
          }
          return true;
      })
  </script>
</html>